<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th>登陆账号</th>
			<th>员工姓名</th>
			<th>角色名称</th>
			<th>身份证</th>
			<th>性别</th>
			<th>年龄</th>
			<th>联系方式</th>
			<th>操作员</th>
			<th width="50">状态</th>
			<th width="70">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($userlist) && count($userlist)){ ?>
		<?php foreach($userlist as $k=>$user){ ?>
		<tr class="text-c">
			<td><input type="checkbox" value="{$user['userid']}" name=""></td>
			<td>{$user['username']}</td>
			<td>{$user['nickname']}</td>
			<td>{$user['role_name']}</td>
			<td>{$user['card']}</td>
			<td>{$user['sex'] == 1 ? '男' : '女'}</td>
			<td>
				{$user['card']|getAgeByID}岁
			</td>
			<td>{$user['phone']}</td>
			<td>{$user['admin_nick']}</td>
			<td>
				<span class="select-box radius" style="width: 80px">
				  	<select class="select mstatus" size="1" user_id="{$user['userid']}">
					  	<option value="1" <?php echo $user['visible'] == 1 ? 'selected' : ''; ?>>使用</option>
					  	<option value="0" <?php echo $user['visible'] == 0 ? 'selected' : ''; ?>>禁用</option>
				  	</select>
				</span>		
			</td>
			<td>
				<a href="javascript:void(0);" title="编辑" onclick="admin_role_edit('编辑员工信息','admin_add.html?userid={$user['userid']}', 1,'1020', '500');" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>&nbsp;&nbsp;
			</td>
		</tr>
		<?php } }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<script>
	$(document).ready(function(){
		$(".mstatus").on('change', function(){
			var obj = $(this);
			$.post('setStatus.html', {userid: obj.attr('user_id'), visible: obj.val()}, function(row){
				if(row/1){
					layer.msg('设置成功', {icon:1, time: 2000});
				}else{
					layer.msg('设置失败', {icon:0, time: 2000});
				}
			});
		});
	});
</script>
<!--page-->
<include file="Common/page" />